<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $settingfile = SITE_ROOT . "/data/setting/{$site_url}/setting.txt"; $defaultsettingfile = SITE_ROOT . "/data/default.setting.txt"; $site['logofile'] = array ( 'form' => 'input', "type" => "file", "name" => "LOGO文件", 'description' => '图片格式必须为.jpg或.gif格式', "class" => "uploadbtn marginbot", 'width' => '200px', 'height' => '18px' ); $site['logofile_alt'] = array ( 'form' => 'input', "type"=>"text", "name" => "LOGO图片标题", 'description' => '网站LOGO的图片标题', "class" => "txt", 'width' => '300px', 'height' => '18px' ); $site['banner_flv'] = array ( 'form' => 'input', "type"=>"text", "name" => "默认BANNER视频的链接地址", 'description' => '如果开启视频BANNER，请输入正确的“FLV”视频文件的地址', "class" => "txt", 'width' => '300px', 'height' => '18px' ); $site['site_bgsound'] = array ( 'form' => 'input', "type"=>"text", "name" => "首页背音乐MP3文件URL地址", 'description' => '只能是正确的MP3格式，若开启，则输入mp3地址', "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_name'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业名称", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_trade'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业所属行业", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_type'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业性质", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_service'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业主营产品/服务", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_area'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业所在地区", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_create'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业成立时间", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_employ'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业员工人数", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_turnover'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业年营业额", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_linkman'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业联系人", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_telephone'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业联系电话", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_fax'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业传真", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_post'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业邮政编码", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $com['company_email'] = array ( 'form' => 'input', "type"=>"text", "name" => "Email", "class" => "txt", "description" => "管理员信箱", 'width' => '300px', 'height' => '18px' ); $com['company_qq1'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业QQ", "class" => "txt", "description" => "只能填一个数字QQ号码", 'width' => '300px', 'height' => '18px' ); $com['company_qq2'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业QQ", "class" => "txt", "description" => "只能填一个数字QQ号码", 'width' => '300px', 'height' => '18px' ); $com['company_address'] = array ( 'form' => 'input', "type"=>"text", "name" => "企业联系地址", "class" => "txt", 'width' => '300px', 'height' => '18px' ); $seo['seo_title'] = array ( 'form' => 'input', "type"=>"text", "name" => "SEO标题", "class" => "txt", "description" => "", 'width' => '300px', 'height' => '18px' ); $seo['seo_description'] = array ( 'form' => 'textarea', "name" => "SE0描述", "class" => "txt", "description" => "SEO描述信息", 'width' => '400px', 'height' => '100px' ); $seo['seo_keywords'] = array ( 'form' => 'input', "type"=>"text", "name" => "SEO关键词", "class" => "txt", "description" => "", 'width' => '300px', 'height' => '18px' ); $seo['seo_author'] = array ( 'form' => 'input', "type"=>"text", "name" => "SEO作者", "class" => "txt", "description" => "", 'width' => '300px', 'height' => '18px' ); $seo['seo_copyright'] = array ( 'form' => 'input', "type"=>"text", "name" => "SEO版权信息", "class" => "txt", "description" => "", 'width' => '300px', 'height' => '18px' ); $app['auto_start_editor'] = array ( 'form' => 'input', "type" =>"radio", "name" => "是否默认启用HTML编辑器", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”", 'list' => array(1 => '开启', 4 => '关闭'), 'width' => '50px', 'height' => '18px' ); $app['mobile_web'] = array ( 'form' => 'input', "type" =>"radio", "name" => "是否开启手机版网站访问", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”", 'list' => array(1 => '开启', 4 => '关闭'), 'width' => '50px', 'height' => '18px' ); $app['watermark'] = array ( 'form' => 'input', "type" => "file", "name" => "网站图片水印文件", 'description' => '尽量使用PNG格式', "class" => "uploadbtn marginbot", 'width' => '200px', 'height' => '18px' ); $app['auto_image'] = array ( 'form' => 'input', "type" =>"radio", "name" => "发内容时，是否自动下载远程图片", "class" => "txt", "description" => "可选值为：“1”表示开启，“4”表示关闭，默认为“4”", 'list' => array(1 => '开启', 4 => '关闭'), 'width' => '50px', 'height' => '18px' ); $app['display_guest'] = array ( 'form' => 'input', "type" =>"radio", "name" => "首页是否显示在线客服", "class" => "txt", "description" => "可选值为：“1”表示开启，“4”表示关闭，默认为“4”", 'list' => array(1 => '开启', 4 => '关闭'), 'width' => '50px', 'height' => '18px' ); $app['stat_code'] = array ( 'form' => 'textarea', "name" => "网站使用的统计代码", "class" => "tarea", "description" => "", 'width' => '300px', 'height' => '100px' ); $app['swap_links'] = array ( 'form' => 'textarea', "name" => "网站友情链接", "class" => "tarea", "description" => "友情链接格式如下：多个友情链接请用逗号“,”隔开或者一行一个：<br/>&nbsp;&nbsp;文字格式举例：建站软件|http://www.xsite.cn<br/>&nbsp;&nbsp;图片格式举例：建站软件|http://www.xsite.cn|/templates/default/logo.gif", 'width' => '300px', 'height' => '100px' ); $app['online_service'] = array ( 'form' => 'textarea', "name" => "网站客服信息设置", "class" => "tarea", "description" => "请按以下格式输入客服信息(举例)：<br/>&nbsp;&nbsp;QQ：28693177<br/>&nbsp;&nbsp;TEL：020-37202015<br />&nbsp;&nbsp;TEL：15360819831<br />&nbsp;&nbsp;WW：dnok<br />&nbsp;&nbsp;TB:dnok", 'width' => '300px', 'height' => '100px' ); $app['website_icp'] = array ( 'form' => 'input', "type"=>"text", "name" => "ICP备案信息", "class" => "txt", "description" => "ICP备案号", 'width' => '300px', 'height' => '18px' ); $app['copyright'] = array ( 'form' => 'textarea', "name" => "网站底部版权处设置", "class" => "tarea", "description" => "请使用HTML代码", 'width' => '300px', 'height' => '100px' ); if (!empty($_POST['dosubmit'])) { $savedata = $_POST['data']; if (isset($_POST['del_file']) && is_array($_POST['del_file']) && count($_POST['del_file'])) { if (array_key_exists('logofile', $_POST['del_file'])) { if (file_exists($savedata['logofile']) && preg_match("/^attachments/i", $savedata['logofile'])) @unlink($savedata['logofile']); $savedata['logofile'] = ''; } } if (!empty($_FILES['logofile']['name'])) { $fileinfo = upload_images('logofile', $user_upload_dir, 0); if (is_array($fileinfo) && array_key_exists('name', $fileinfo) && array_key_exists('path', $fileinfo)) { if (file_exists($savedata['logofile']) && preg_match("/^attachments/i", $savedata['logofile'])) unlink($savedata['logofile']); $savedata['logofile'] = str_replace(SITE_DIR . '/', '', "{$fileinfo['path']}{$fileinfo['name']}"); } } if (isset($_POST['del_file']) && is_array($_POST['del_file']) && count($_POST['del_file'])) { if (array_key_exists('watermark', $_POST['del_file'])) { if (file_exists($savedata['watermark']) && preg_match("/^attachments/i", $savedata['watermark'])) @unlink($savedata['watermark']); $savedata['watermark'] = ''; } } if (!empty($_FILES['watermark']['name'])) { $fileinfo = upload_images('watermark', $user_upload_dir, 0); if (is_array($fileinfo) && array_key_exists('name', $fileinfo) && array_key_exists('path', $fileinfo)) { if (file_exists($savedata['watermark']) && preg_match("/^attachments/i", $savedata['watermark'])) unlink($savedata['watermark']); $savedata['watermark'] = str_replace(SITE_DIR . '/', '', "{$fileinfo['path']}{$fileinfo['name']}"); } } save_array_file($savedata, $settingfile); del_cache("setting"); if (defined('XSITE_MU') && defined('SITE_HOST')) { $data = array(); $data['logofile'] = str_filter($savedata['logofile'], ''); $data['site_title'] = str_filter($savedata['company_name'], '某某公司名字'); $data['site_description'] = str_filter($savedata['seo_description'], '业务描述'); $data['site_keywords'] = str_filter($savedata['seo_keywords'], '关键词'); $data['site_email'] = str_filter($savedata['company_email'], 'xsite@qq.com'); $data['admin_name'] = str_filter($savedata['company_linkman'], '陈先生'); $data['admin_qq'] = str_filter($savedata['company_qq1'], '12345678'); $data['admin_tel'] = str_filter($savedata['company_telephone'], '1331245678'); @$db->update("xsite_cloud", $data, "site_id = '{$site_id}'"); } message("xsite.php?action=setting", "更改设置成功"); } else { if (file_exists($settingfile) && filesize($settingfile) > 0) { $form = read_array_file($settingfile); } else { $form = read_array_file($defaultsettingfile); } if (is_array($form) && count($form) > 0) foreach ($form as $k => $v) { if (array_key_exists($k, $site)) $site[$k]['value'] = $v; if (array_key_exists($k, $com)) $com[$k]['value'] = $v; if (array_key_exists($k, $seo)) $seo[$k]['value'] = $v; if (array_key_exists($k, $app)) $app[$k]['value'] = $v; } include SITE_ROOT . "/admin/tpl/setting.tpl.php"; } ?>